package com.ajavaer.framework.message;

import java.util.Map;

/**
 * 微信公众号消息
 */
public class WeixinPublicMessage {
    private String fromUserName;
    private String toUserName;
    private String msgType;//消息类型:text、image、voice、video、shortvideo(小视频)、location(地理位置)、link(连接消息)
    private String content;//
    private String event;//msgType为event时：subscribe(订阅)、unsubscribe(取消订阅)、SCAN（扫码）、LOCATION（上报地理位置）、CLICK（自定义菜单事件）、VIEW（点击菜单跳转链接时的事件）

    public WeixinPublicMessage() {

    }

    public WeixinPublicMessage(Map<String, String> map) {
        this.fromUserName = map.get("FromUserName");//消息来源用户标识
        this.toUserName = map.get("ToUserName");//消息目的用户标识
        this.msgType = map.get("MsgType");//消息类型
        this.content = map.get("Content");//消息内容
        this.event = map.get("Event");
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public String getToUserName() {
        return toUserName;
    }

    public void setToUserName(String toUserName) {
        this.toUserName = toUserName;
    }

    public String getMsgType() {
        return msgType;
    }

    public void setMsgType(String msgType) {
        this.msgType = msgType;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }
}
